package cn.itcast.demo.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author 虎哥
 */
@Slf4j
//@Component
public class HelloTask {

    @Scheduled(cron = "0/20 * * * * ?")
    public void job() throws InterruptedException {

        clearOrder();
    }

    private void clearOrder() {
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("开始清理订单。。");
    }
}
